﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Master/MasterPage_New.master"
    CodeBehind="AreaGoodsList.aspx.cs" Inherits="HZ.Supervise.Web.Secondphase.ReportArea.GoodsList"
    Title="所有药品信息" %>

<%@ Register Src="~/Common/QueryControl.ascx" TagName="QueryControl" TagPrefix="uc1" %>
<%@ Register Src="~/Common/ChartControl.ascx" TagName="ChartControl" TagPrefix="uc2" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <script language="javascript" type="text/jscript">
        function document.onkeydown() {
            //使用document.getElementById获取到按钮对象
            var btn = document.getElementById('<%=btnQuery.ClientID%>');
            if (event.keyCode == 13) {
                btn.click();
                event.returnValue = false;
            }
        }
    </script>

    <div id="tabnav">
        <ul>
            <li class="active"><a href="#" target="_blank">所有药品信息</a> </li>
        </ul>
    </div>
    <div id="tabcontent">
        <table class="querylist">
            <tr>
                <td align="right">
                    通用名：
                </td>
                <td align="left">
                    <asp:TextBox ID="txtProductName" MaxLength="25" runat="server"></asp:TextBox>
                </td>
                <td align="right">
                    剂型：
                </td>
                <td align="left">
                    <asp:TextBox ID="txtMedicineModelName" MaxLength="25" runat="server"></asp:TextBox>
                </td>
                <td align="right">
                    采购规格：
                </td>
                <td align="left">
                    <asp:TextBox ID="txtPack" MaxLength="25" runat="server"></asp:TextBox>
                </td>
                <td colspan="4" align="center">
                    <asp:Button ID="btnQuery" runat="server" Text="查  询" CssClass="btn" SkinID="search"
                        ToolTip="点击查询符合条件的数据" OnClick="btnQuery_Click" />
                </td>
            </tr>
            <tr>
                <td align="right">
                    生产企业：
                </td>
                <td align="left">
                    <asp:TextBox ID="txtCompanyName_SC" MaxLength="25" runat="server"></asp:TextBox>
                </td>
                <td align="right">
                    采购单位：
                </td>
                <td align="left">
                    <asp:TextBox ID="txtUnit" MaxLength="25" runat="server"></asp:TextBox>
                </td>
                <td align="right">
                    排序字段：
                </td>
                <td align="left">
                    <asp:DropDownList ID="droSortField" runat="server" Height="19px" Width="120px">
                        <%--<asp:ListItem Value="PurchaseAmountTotal desc">采购总金额 降序</asp:ListItem>
                        <asp:ListItem Value="PurchaseAmountTotal asc">采购总金额 升序</asp:ListItem>
                        <asp:ListItem Value="PurchaseCountTotal asc">采购总数量 升序</asp:ListItem>
                        <asp:ListItem Value="PurchaseCountTotal desc">采购总数量 降序</asp:ListItem>
                        <asp:ListItem Value="WareHouseCountTotal asc">入库总数量 升序</asp:ListItem>
                        <asp:ListItem Value="WareHouseCountTotal desc">入库总数量 降序</asp:ListItem>
                        <asp:ListItem Value="WareHouseAmountTotal asc">入库总金额 升序</asp:ListItem>
                        <asp:ListItem Value="WareHouseAmountTotal desc">入库总金额 降序</asp:ListItem>--%>
                        <asp:ListItem Value="PurchaseAmountTotal asc">采购总金额 升序</asp:ListItem>
                        <asp:ListItem Value="PurchaseAmountTotal desc" Selected="True">采购总金额 降序</asp:ListItem>
                        <asp:ListItem Value="WareHouseAmountTotal asc">入库总金额 升序</asp:ListItem>
                        <asp:ListItem Value="WareHouseAmountTotal desc">入库总金额 降序</asp:ListItem>
                        <asp:ListItem Value="DistributeAmountTotal asc">配送金额 升序</asp:ListItem>
                        <asp:ListItem Value="DistributeAmountTotal desc">配送金额 降序</asp:ListItem>
                        <asp:ListItem Value="WareHouseRate asc">入库率 升序</asp:ListItem>
                        <asp:ListItem Value="WareHouseRate desc">入库率 降序</asp:ListItem>
                        <asp:ListItem Value="DistributeRate asc">配送率 升序</asp:ListItem>
                        <asp:ListItem Value="DistributeRate desc">配送率 降序</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right">
                    采购类型：
                </td>
                <td align="left">
                    <asp:DropDownList ID="droSort" runat="server" Height="19px" Width="120px">
                        <asp:ListItem Value="-1">全部</asp:ListItem>
                        <asp:ListItem Value="0">日常采购</asp:ListItem>
                        <asp:ListItem Value="1">临时采购</asp:ListItem>
                        <asp:ListItem Value="2">应急采购</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
        </table>
    </div>
    <asp:GridView ID="gvwGoods" CssClass="mainlist" runat="server" AutoGenerateColumns="False"
        EmptyDataText="暂无有效的信息！" PageSize="24" OnRowDataBound="gvwGoods_RowDataBound"
        OnRowCommand="gvwGoods_RowCommand" OnRowCreated="gvwGoods_RowCreated">
        <Columns>
            <asp:BoundField HeaderText="流水号" DataField="ProcureCatalogID" Visible="false" />
            <asp:TemplateField HeaderText="采购类型">
                <ItemTemplate>
                    <%#HZ.Supervise.Web.Function.FormatDrugSource(Eval("SortSource"))%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField HeaderText="通用名" DataField="ProductName" />
            <asp:BoundField HeaderText="剂型" DataField="MedicineModelName" />
            <asp:BoundField HeaderText="采购规格" DataField="Pack" />
            <asp:BoundField HeaderText="采购单位" DataField="Unit" />
            <asp:BoundField HeaderText="生产企业" DataField="CompanyName_SC" />
            <asp:BoundField HeaderText="采购金额" DataField="PurchaseAmountTotal" />
            <asp:BoundField HeaderText="配送金额" DataField="DistributeAmountTotal" />
            <asp:BoundField HeaderText="配送率" DataField="DataRate_PS" />
            <asp:BoundField HeaderText="入库金额" DataField="WareHouseAmountTotal" />
            <asp:BoundField HeaderText="入库率" DataField="addDataColumnRate" />
            <asp:TemplateField HeaderText="操作">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="lbnDetail" runat="server" CommandName="DirectByDetail" CommandArgument='<%# Eval("ProcureCatalogID")%>'>查看详细</asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <div>
        <span style="float: left; width: 30%">
            <hz:HzButton ID="btnExcel" runat="server" CssClass="btn" Text="导出数据" OnClick="btnExcel_Click" />
        </span><span style="float: right; width: 70%">
            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_PageChanged"
                Height="20px" ShowPageSizeBox="True" AlwaysShow="True">
            </webdiyer:AspNetPager>
        </span>
    </div>
    <div class="listip">
        <ul>
            <li style="clear: left">说明：1.<span>此数据为静态表数据,每24小时统计一次</span> </li>
            <li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.<span>配送率计算方式为：配送金额/采购金额；入库率计算方式为：入库金额/采购金额。</span>
            </li>
        </ul>
    </div>
</asp:Content>
